package so.sao.code.service.infrastructure.enums.convert;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

import so.sao.code.service.infrastructure.enums.SEQ_TYPE;

@Converter(autoApply = true)
public class SeqTypeConvert implements AttributeConverter<SEQ_TYPE, Integer> {

	@Override
	public Integer convertToDatabaseColumn(SEQ_TYPE attribute) {
		return attribute.getValue();
	}

	@Override
	public SEQ_TYPE convertToEntityAttribute(Integer dbData) {
		return SEQ_TYPE.fromValue(dbData);
	}

}
